package ua.edu.sumdu.j2se.roman.lab1.view.console;

import ua.edu.sumdu.j2se.roman.lab1.view.DeleteView;

import java.util.Scanner;

/**
 * Author: Radko Roman.
 */

/**
 * This class responsible for creating console dialog with user on case if need to delete task to the list.
 *
 */
public class ConsoleDeleteView implements DeleteView {
    /**
     * Creates to read task title from the console.
     *
     */
    private Scanner scanner;
    /**
     * Contains title of the deleting task.
     *
     */
    private String titleOfTheDeletingTask;

    public ConsoleDeleteView() {
        scanner = new Scanner(System.in);
    }

    /**
     * Gets from the view title of the deleting task.
     *
     * @return
     */
    @Override
    public String getTitleOfTheDeletingTask() {
        return titleOfTheDeletingTask;
    }
    /**
     * Ask user to enter title of the removing task and delete it.
     *
     */
    @Override
    public void show() {
        System.out.println("Insert your task title:");
        titleOfTheDeletingTask = scanner.nextLine();
    }

}
